home *** CD-ROM | disk | FTP | other *** search
/ Amiga Desktop Video CD / Amiga DeskTop Video CD.iso / install / forceicon / source / error.h < prev    next >
C/C++ Source or Header  |  1994-06-23  |  5KB  |  183 lines

  1. /*
  2. Auto:        smake ForceIcon
  3. */
  4.  
  5.  
  6.  
  7. /* $Revision Header built automatically *************** (do not edit) ************
  8. **
  9. ** © Copyright by GuntherSoft
  10. **
  11. ** File             : SnakeSYS:CPrgs/Utils/ForceIcon/Error.c
  12. ** Created on       : Saturday, 23.10.93 14:30:06
  13. ** Created by       : Kai Iske
  14. ** Current revision : V1.0
  15. **
  16. **
  17. ** Purpose
  18. ** -------
  19. **   - Error-Handling for ForceIcon
  20. **
  21. ** Revision V1.0
  22. ** --------------
  23. ** created on Saturday, 23.10.93 14:30:06  by  Kai Iske.   LogMessage :
  24. **     --- Initial release ---
  25. **
  26. *********************************************************************************/
  27.  
  28.  
  29.  
  30.  
  31. /**********************************************************************/
  32. /*                          Internal errors                           */
  33. /**********************************************************************/
  34. static char *InternalErrs[] =
  35. {
  36.     "%s verion %ld could not be opened.",
  37.  
  38.     "Sorry, out of memory",
  39.  
  40.     "Sorry, not all entries from DOS-List\ncould be collected.",
  41.  
  42. #ifdef PREFSRUN
  43.     "ForceIcon v%ld.%ld, (%s)\n"
  44.         "by Kai Iske, GiftWare\n\n"
  45.         "Reach me under\n"
  46.         "   Kai Iske, Brucknerstrasse 18, 63452 Hanau, Germany\n"
  47.         "                  Tel.: +49-(0)6181-850181\n"
  48.         "or electronically\n"
  49.         "   UseNet:   kai@iske.adsp.sub.org\n"
  50.         "   Internet: iske@informatik.uni-frankfurt.de\n"
  51.         "   Fido:     Kai Iske, 2:244/6302.11\n"
  52.         "   ZNet:     KAI@SWEET.ZER\n\n"
  53.         "ForceIcon (Prefs) is a MUI application; MUI © Stefan Stuntz",
  54.  
  55.     "Volume %s\nhas already been selected.",
  56.  
  57.     "No negative values please.",
  58.  
  59.     "",
  60.  
  61.     "",
  62. #else
  63.     "",
  64.  
  65.     "",
  66.  
  67.     "",
  68.  
  69.     "Someone else has patched GetIcon() and Lock() vectors.\n"
  70.     "Please remove the other program(s) first.\n"
  71.     "Can not quit yet. Continuing program.",
  72.  
  73.     "Someone else has patched %s vector.\n"
  74.     "Please remove the other program(s) first.\n"
  75.     "Can not quit yet. Continuing program.",
  76. #endif
  77.  
  78. #ifdef PREFSRUN
  79.     "",
  80.  
  81.     "Application object for windows\n"
  82.     "could not be created."
  83. #else
  84.     "Removing ForceIcon.",
  85.  
  86.     ""
  87. #endif
  88. };
  89.  
  90.  
  91.  
  92. /**********************************************************************/
  93. /*                             IFF-Errors                             */
  94. /**********************************************************************/
  95. static char *IFFErrs[] =
  96. {
  97.     "IFF-Error\nEnd of file reached before completing parse.",
  98.     "IFF-Error\nAn IFF-Chunk could not be read.",
  99.     "IFF-Error\nChunk-Contents didn`t reside at expected position.",
  100.     "IFF-Error\nInternal memory could not be allocated.",
  101.     "IFF-Error\nError while reading from file.\nFile could probably not be opened.",
  102.     "IFF-Error\nError while writing to file.\nFile could probably not be opened.",
  103.     "IFF-Error\nError while seeking through file.\n%s",
  104.     "IFF-Error\nData within file corrupt.\n%s",
  105.     "IFF-Error\nSyntax error within file.\n%s",
  106.     "IFF-Error\n%s\nis not an IFF file."
  107. };
  108.  
  109.  
  110.  
  111.  
  112.  
  113. /**********************************************************************/
  114. /*                          Display an error                          */
  115. /**********************************************************************/
  116. static void __stdargs DisplayError(LONG ErrCode, ULONG Arg1, ...)
  117. {
  118.     struct EasyStruct MyRequest =
  119.     {
  120.         sizeof(struct EasyStruct),
  121.         0,
  122.         NULL,
  123.         NULL,
  124.         NULL
  125.     };
  126.  
  127.     if(!IntuitionBase)
  128.         return;
  129.  
  130.         // Set header for Requester
  131.  
  132.     MyRequest.es_Title        = "ForceIcon";
  133.     MyRequest.es_GadgetFormat    = "Ok";
  134.  
  135.  
  136.         // Set correct text
  137.  
  138.     if((ErrCode >= 0) && (ErrCode < 200))
  139.     {
  140.         MyRequest.es_TextFormat = InternalErrs[ErrCode];
  141. #ifdef PREFSRUN
  142.         if(MainWindow && AppObject && MUIMasterBase)
  143.             MUI_RequestA(AppObject, MainWindow, 0, NULL, "*Ok", MyRequest.es_TextFormat, &Arg1);
  144.         else
  145.             EasyRequestArgs(NULL, &MyRequest, NULL, &Arg1);
  146. #else
  147.         EasyRequestArgs(NULL, &MyRequest, NULL, &Arg1);
  148. #endif
  149.     }
  150.  
  151.     else if((ErrCode >= 200) && (ErrCode < 226))
  152.     {
  153.         char    Buffer[128];
  154.  
  155.         Fault(ErrCode, NULL, Buffer, 128);
  156.  
  157.         MyRequest.es_TextFormat = "DOS-Error %ld\n%s";
  158.  
  159. #ifdef PREFSRUN
  160.         if(MainWindow && AppObject && MUIMasterBase)
  161.             MUI_RequestA(AppObject, MainWindow, 0, NULL, "*Ok", MyRequest.es_TextFormat, &Arg1);
  162.         else
  163.             EasyRequestArgs(NULL, &MyRequest, NULL, &Arg1);
  164. #else
  165.         EasyRequestArgs(NULL, &MyRequest, NULL, &Arg1);
  166. #endif
  167.     }
  168.  
  169.     else if(ErrCode < 0)
  170.     {
  171.         MyRequest.es_TextFormat = IFFErrs[((-ErrCode) - 1)];
  172.  
  173. #ifdef PREFSRUN
  174.         if(MainWindow && AppObject && MUIMasterBase)
  175.             MUI_RequestA(AppObject, MainWindow, 0, NULL, "*Ok", MyRequest.es_TextFormat, &Arg1);
  176.         else
  177.             EasyRequestArgs(NULL, &MyRequest, NULL, &Arg1);
  178. #else
  179.         EasyRequestArgs(NULL, &MyRequest, NULL, &Arg1);
  180. #endif
  181.     }
  182. }
  183.